package top.frsf.mqtt.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * MQTT服务器配置类
 *
 * @author He Kuntao
 * @since 2025/5/26 14:52
 */
@Data
@Component
@ConfigurationProperties(prefix = "mqtt")
public class ServerProperties {
    /**
     * 服务器绑定的端口号
     */
    private int port = 1883;

    /**
     * boss线程数
     */
    private int bossThreads = 1;

    /**
     * 工作线程数
     */
    private int workerThreads = Runtime.getRuntime().availableProcessors() * 2;

    /**
     * 连接请求队列长度
     */
    private int backlog = 128;

    /**
     * 是否启用连接保持alive
     */
    private boolean keepAlive = true;
}
